﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Sites/Site.Master" AutoEventWireup="true" CodeBehind="AddEditNews.aspx.cs" Inherits="StudentPortal.News.AddEditNews" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            width: 168px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table class="style1">
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td>
                <asp:ValidationSummary ID="vsSummary" runat="server" ForeColor="Red" 
                    ValidationGroup="g1" />
            </td>
        </tr>
        <tr>
            <td class="style2">
                หัวข้อประกาศ</td>
            <td>
                <asp:TextBox ID="txtAnnoucement" runat="server"></asp:TextBox>
&nbsp;<asp:RequiredFieldValidator ID="txtAnnoucementReq" runat="server" 
                    ControlToValidate="txtAnnoucement" ErrorMessage="โปรดกรอกข้อมูล" 
                    ForeColor="#FF3300" ValidationGroup="g1"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style2">
                Password</td>
            <td>
                <asp:TextBox ID="txtPassword" runat="server" TextMode="Password" 
                    ValidationGroup="g1" ClientIDMode="AutoID"></asp:TextBox>
&nbsp;</td>
        </tr>
        <tr>
            <td class="style2">
                Confirm Password</td>
            <td>
                <asp:TextBox ID="txtPasswordConfirm" runat="server" TextMode="Password" 
                    ValidationGroup="g1"></asp:TextBox>
&nbsp;<asp:CompareValidator ID="txtConfirmCompare" runat="server" 
                    ControlToCompare="txtPassword" ControlToValidate="txtPasswordConfirm" 
                    ErrorMessage="รหัสผ่านไม่ตรง" ForeColor="Red" ValidationGroup="g1"></asp:CompareValidator>
            </td>
        </tr>
        <tr>
            <td class="style2">
                อายุ
            </td>
            <td>
                <asp:TextBox ID="txtAge" runat="server"></asp:TextBox>
                <asp:RangeValidator ID="txtAgeRange" runat="server" ControlToValidate="txtAge" 
                    ErrorMessage="อนุญาติเฉพาะ18+" ForeColor="Red" MaximumValue="100" 
                    MinimumValue="18" Type="Integer" ValidationGroup="g1"></asp:RangeValidator>
            </td>
        </tr>
        <tr>
            <td class="style2">
                อีเมล์</td>
            <td>
                <asp:TextBox ID="txtEmail" runat="server" ValidationGroup="g1"></asp:TextBox>
                <asp:RegularExpressionValidator ID="txtEmailRegx" runat="server" 
                    ControlToValidate="txtEmail" ErrorMessage="อีเมล์ไม่ถูกต้อง" ForeColor="Red" 
                    ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" 
                    ValidationGroup="g1"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td class="style2">
                username</td>
            <td>
                <asp:TextBox ID="txtUsername" runat="server" ValidationGroup="g1"></asp:TextBox>
                <asp:CustomValidator ID="txtUsernameCustom" runat="server" 
                    ControlToValidate="txtUsername" ErrorMessage="ตั้งชื่อ  admin ไม่ได้" 
                    ForeColor="Red" onservervalidate="username_ServerValidate" ValidationGroup="g1"></asp:CustomValidator>
            </td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td>
                <asp:Button ID="btnSubmit" runat="server" Text="ยืนยัน" ValidationGroup="g1" 
                    onclick="btnSubmit_Click" />
                <asp:Button ID="New" runat="server" Text="New" ValidationGroup="g2" />
            </td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>
